{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Importing PulP solver\n",
    "from pulp import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Demand points\n",
    "demand_points=['Mina Salman','Port of Haifa']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Mina Salman', 'Port of Haifa']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "demand_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Supply Points\n",
    "supply_points=['Port of Buenos Aires','Port of Antwerp','Port of Santos','Port of Montreal','Port of Vancouver','Port of Shanghai','Buenaventura','Port of Alexandria','Port of Marseille','Port of Hamburg_Germany','Port of Jawaharlal Nehru','Port of Gioia Tauro','Port of Nagoya','Port of Busan','Port of Shuwaikh','Penang Port','Port of Manzanillo','Port of Rotterdam','Port of Lagos','Port of Salalah','Port of Gdansk','Port of Doha','Port of King Abdul Aziz','Port of Jeddah','Port of Singapore','Port of Durban','Port of Algeciras','Port of Bangkok','Port of Jebel Ali','Port of Immingham','Port of New York','Port of Los Angeles','Port of Saigon']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Buenos Aires',\n",
       " 'Port of Antwerp',\n",
       " 'Port of Santos',\n",
       " 'Port of Montreal',\n",
       " 'Port of Vancouver',\n",
       " 'Port of Shanghai',\n",
       " 'Buenaventura',\n",
       " 'Port of Alexandria',\n",
       " 'Port of Marseille',\n",
       " 'Port of Hamburg_Germany',\n",
       " 'Port of Jawaharlal Nehru',\n",
       " 'Port of Gioia Tauro',\n",
       " 'Port of Nagoya',\n",
       " 'Port of Busan',\n",
       " 'Port of Shuwaikh',\n",
       " 'Penang Port',\n",
       " 'Port of Manzanillo',\n",
       " 'Port of Rotterdam',\n",
       " 'Port of Lagos',\n",
       " 'Port of Salalah',\n",
       " 'Port of Gdansk',\n",
       " 'Port of Doha',\n",
       " 'Port of King Abdul Aziz',\n",
       " 'Port of Jeddah',\n",
       " 'Port of Singapore',\n",
       " 'Port of Durban',\n",
       " 'Port of Algeciras',\n",
       " 'Port of Bangkok',\n",
       " 'Port of Jebel Ali',\n",
       " 'Port of Immingham',\n",
       " 'Port of New York',\n",
       " 'Port of Los Angeles',\n",
       " 'Port of Saigon']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "supply_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the distances\n",
    "distance = dict(zip(supply_points,[dict(zip(demand_points, [9420,8747])),\n",
    "dict(zip(demand_points, [7193,3804])),\n",
    "dict(zip(demand_points, [9662,7667])),\n",
    "dict(zip(demand_points, [9594,6336])),\n",
    "dict(zip(demand_points, [15871,12461])),\n",
    "dict(zip(demand_points, [6882,8336])),\n",
    "dict(zip(demand_points, [11561,8173])),\n",
    "dict(zip(demand_points, [3650,370])),\n",
    "dict(zip(demand_points, [5332,1946])),\n",
    "dict(zip(demand_points, [7561,4173])),\n",
    "dict(zip(demand_points, [1589,3510])),\n",
    "dict(zip(demand_points, [4620,1230])),\n",
    "dict(zip(demand_points, [7759,9214])),\n",
    "dict(zip(demand_points, [7398,8852])),\n",
    "dict(zip(demand_points, [310,3847])),\n",
    "dict(zip(demand_points, [3856,5310])),\n",
    "dict(zip(demand_points, [13061,9673])),\n",
    "dict(zip(demand_points, [7284,3894])),\n",
    "dict(zip(demand_points, [8570,5662])),\n",
    "dict(zip(demand_points, [1253,2367])),\n",
    "dict(zip(demand_points, [8277,4889])),\n",
    "dict(zip(demand_points, [140,3553])),\n",
    "dict(zip(demand_points, [108,3674])),\n",
    "dict(zip(demand_points, [2626,995])),\n",
    "dict(zip(demand_points, [4226,5680])),\n",
    "dict(zip(demand_points, [4824,5318])),\n",
    "dict(zip(demand_points, [5631,2242])),\n",
    "dict(zip(demand_points, [5102,6556])),\n",
    "dict(zip(demand_points, [327,3366])),\n",
    "dict(zip(demand_points, [7334,3944])),\n",
    "dict(zip(demand_points, [9168,5756])),\n",
    "dict(zip(demand_points, [14552,11048])),\n",
    "dict(zip(demand_points, [4964,6418]))]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Buenos Aires': {'Mina Salman': 9420, 'Port of Haifa': 8747},\n",
       " 'Port of Antwerp': {'Mina Salman': 7193, 'Port of Haifa': 3804},\n",
       " 'Port of Santos': {'Mina Salman': 9662, 'Port of Haifa': 7667},\n",
       " 'Port of Montreal': {'Mina Salman': 9594, 'Port of Haifa': 6336},\n",
       " 'Port of Vancouver': {'Mina Salman': 15871, 'Port of Haifa': 12461},\n",
       " 'Port of Shanghai': {'Mina Salman': 6882, 'Port of Haifa': 8336},\n",
       " 'Buenaventura': {'Mina Salman': 11561, 'Port of Haifa': 8173},\n",
       " 'Port of Alexandria': {'Mina Salman': 3650, 'Port of Haifa': 370},\n",
       " 'Port of Marseille': {'Mina Salman': 5332, 'Port of Haifa': 1946},\n",
       " 'Port of Hamburg_Germany': {'Mina Salman': 7561, 'Port of Haifa': 4173},\n",
       " 'Port of Jawaharlal Nehru': {'Mina Salman': 1589, 'Port of Haifa': 3510},\n",
       " 'Port of Gioia Tauro': {'Mina Salman': 4620, 'Port of Haifa': 1230},\n",
       " 'Port of Nagoya': {'Mina Salman': 7759, 'Port of Haifa': 9214},\n",
       " 'Port of Busan': {'Mina Salman': 7398, 'Port of Haifa': 8852},\n",
       " 'Port of Shuwaikh': {'Mina Salman': 310, 'Port of Haifa': 3847},\n",
       " 'Penang Port': {'Mina Salman': 3856, 'Port of Haifa': 5310},\n",
       " 'Port of Manzanillo': {'Mina Salman': 13061, 'Port of Haifa': 9673},\n",
       " 'Port of Rotterdam': {'Mina Salman': 7284, 'Port of Haifa': 3894},\n",
       " 'Port of Lagos': {'Mina Salman': 8570, 'Port of Haifa': 5662},\n",
       " 'Port of Salalah': {'Mina Salman': 1253, 'Port of Haifa': 2367},\n",
       " 'Port of Gdansk': {'Mina Salman': 8277, 'Port of Haifa': 4889},\n",
       " 'Port of Doha': {'Mina Salman': 140, 'Port of Haifa': 3553},\n",
       " 'Port of King Abdul Aziz': {'Mina Salman': 108, 'Port of Haifa': 3674},\n",
       " 'Port of Jeddah': {'Mina Salman': 2626, 'Port of Haifa': 995},\n",
       " 'Port of Singapore': {'Mina Salman': 4226, 'Port of Haifa': 5680},\n",
       " 'Port of Durban': {'Mina Salman': 4824, 'Port of Haifa': 5318},\n",
       " 'Port of Algeciras': {'Mina Salman': 5631, 'Port of Haifa': 2242},\n",
       " 'Port of Bangkok': {'Mina Salman': 5102, 'Port of Haifa': 6556},\n",
       " 'Port of Jebel Ali': {'Mina Salman': 327, 'Port of Haifa': 3366},\n",
       " 'Port of Immingham': {'Mina Salman': 7334, 'Port of Haifa': 3944},\n",
       " 'Port of New York': {'Mina Salman': 9168, 'Port of Haifa': 5756},\n",
       " 'Port of Los Angeles': {'Mina Salman': 14552, 'Port of Haifa': 11048},\n",
       " 'Port of Saigon': {'Mina Salman': 4964, 'Port of Haifa': 6418}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Plastic Demand\n",
    "plastic_demand=dict(zip(demand_points, [275042389.8,239192472.7]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Mina Salman': 275042389.8, 'Port of Haifa': 239192472.7}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plastic_demand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Plastic Supply\n",
    "plastic_supply=dict(zip(supply_points, [3484953.6435,3021067.5020,7945692.0017,1637839.3004,7771532.4984,234997919.6606,2509165.8953,731840.0219,6474235.9733,16669297.2185,10078880.5696,9565903.5174,13163659.9622,44795024.7538,887965.8933,12318631.8073,6272914.5326,2745849.6660,243946.6740,665974.4200,4350000.5481,1775931.7866,9520988.2609,5352440.4517,20157761.1392,1219733.3699,5144723.8347,19037885.5204,3995846.5198,5051019.5284,27723150.5426,19323708.4517,5599378.0942])) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Buenos Aires': 3484953.6435,\n",
       " 'Port of Antwerp': 3021067.502,\n",
       " 'Port of Santos': 7945692.0017,\n",
       " 'Port of Montreal': 1637839.3004,\n",
       " 'Port of Vancouver': 7771532.4984,\n",
       " 'Port of Shanghai': 234997919.6606,\n",
       " 'Buenaventura': 2509165.8953,\n",
       " 'Port of Alexandria': 731840.0219,\n",
       " 'Port of Marseille': 6474235.9733,\n",
       " 'Port of Hamburg_Germany': 16669297.2185,\n",
       " 'Port of Jawaharlal Nehru': 10078880.5696,\n",
       " 'Port of Gioia Tauro': 9565903.5174,\n",
       " 'Port of Nagoya': 13163659.9622,\n",
       " 'Port of Busan': 44795024.7538,\n",
       " 'Port of Shuwaikh': 887965.8933,\n",
       " 'Penang Port': 12318631.8073,\n",
       " 'Port of Manzanillo': 6272914.5326,\n",
       " 'Port of Rotterdam': 2745849.666,\n",
       " 'Port of Lagos': 243946.674,\n",
       " 'Port of Salalah': 665974.42,\n",
       " 'Port of Gdansk': 4350000.5481,\n",
       " 'Port of Doha': 1775931.7866,\n",
       " 'Port of King Abdul Aziz': 9520988.2609,\n",
       " 'Port of Jeddah': 5352440.4517,\n",
       " 'Port of Singapore': 20157761.1392,\n",
       " 'Port of Durban': 1219733.3699,\n",
       " 'Port of Algeciras': 5144723.8347,\n",
       " 'Port of Bangkok': 19037885.5204,\n",
       " 'Port of Jebel Ali': 3995846.5198,\n",
       " 'Port of Immingham': 5051019.5284,\n",
       " 'Port of New York': 27723150.5426,\n",
       " 'Port of Los Angeles': 19323708.4517,\n",
       " 'Port of Saigon': 5599378.0942}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plastic_supply"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "prob = LpProblem(\"Transportation\", LpMinimize)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "None\n",
       "VARIABLES"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "routes = [(i,j) for i in supply_points for j in demand_points]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Port of Buenos Aires', 'Mina Salman'),\n",
       " ('Port of Buenos Aires', 'Port of Haifa'),\n",
       " ('Port of Antwerp', 'Mina Salman'),\n",
       " ('Port of Antwerp', 'Port of Haifa'),\n",
       " ('Port of Santos', 'Mina Salman'),\n",
       " ('Port of Santos', 'Port of Haifa'),\n",
       " ('Port of Montreal', 'Mina Salman'),\n",
       " ('Port of Montreal', 'Port of Haifa'),\n",
       " ('Port of Vancouver', 'Mina Salman'),\n",
       " ('Port of Vancouver', 'Port of Haifa'),\n",
       " ('Port of Shanghai', 'Mina Salman'),\n",
       " ('Port of Shanghai', 'Port of Haifa'),\n",
       " ('Buenaventura', 'Mina Salman'),\n",
       " ('Buenaventura', 'Port of Haifa'),\n",
       " ('Port of Alexandria', 'Mina Salman'),\n",
       " ('Port of Alexandria', 'Port of Haifa'),\n",
       " ('Port of Marseille', 'Mina Salman'),\n",
       " ('Port of Marseille', 'Port of Haifa'),\n",
       " ('Port of Hamburg_Germany', 'Mina Salman'),\n",
       " ('Port of Hamburg_Germany', 'Port of Haifa'),\n",
       " ('Port of Jawaharlal Nehru', 'Mina Salman'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Haifa'),\n",
       " ('Port of Gioia Tauro', 'Mina Salman'),\n",
       " ('Port of Gioia Tauro', 'Port of Haifa'),\n",
       " ('Port of Nagoya', 'Mina Salman'),\n",
       " ('Port of Nagoya', 'Port of Haifa'),\n",
       " ('Port of Busan', 'Mina Salman'),\n",
       " ('Port of Busan', 'Port of Haifa'),\n",
       " ('Port of Shuwaikh', 'Mina Salman'),\n",
       " ('Port of Shuwaikh', 'Port of Haifa'),\n",
       " ('Penang Port', 'Mina Salman'),\n",
       " ('Penang Port', 'Port of Haifa'),\n",
       " ('Port of Manzanillo', 'Mina Salman'),\n",
       " ('Port of Manzanillo', 'Port of Haifa'),\n",
       " ('Port of Rotterdam', 'Mina Salman'),\n",
       " ('Port of Rotterdam', 'Port of Haifa'),\n",
       " ('Port of Lagos', 'Mina Salman'),\n",
       " ('Port of Lagos', 'Port of Haifa'),\n",
       " ('Port of Salalah', 'Mina Salman'),\n",
       " ('Port of Salalah', 'Port of Haifa'),\n",
       " ('Port of Gdansk', 'Mina Salman'),\n",
       " ('Port of Gdansk', 'Port of Haifa'),\n",
       " ('Port of Doha', 'Mina Salman'),\n",
       " ('Port of Doha', 'Port of Haifa'),\n",
       " ('Port of King Abdul Aziz', 'Mina Salman'),\n",
       " ('Port of King Abdul Aziz', 'Port of Haifa'),\n",
       " ('Port of Jeddah', 'Mina Salman'),\n",
       " ('Port of Jeddah', 'Port of Haifa'),\n",
       " ('Port of Singapore', 'Mina Salman'),\n",
       " ('Port of Singapore', 'Port of Haifa'),\n",
       " ('Port of Durban', 'Mina Salman'),\n",
       " ('Port of Durban', 'Port of Haifa'),\n",
       " ('Port of Algeciras', 'Mina Salman'),\n",
       " ('Port of Algeciras', 'Port of Haifa'),\n",
       " ('Port of Bangkok', 'Mina Salman'),\n",
       " ('Port of Bangkok', 'Port of Haifa'),\n",
       " ('Port of Jebel Ali', 'Mina Salman'),\n",
       " ('Port of Jebel Ali', 'Port of Haifa'),\n",
       " ('Port of Immingham', 'Mina Salman'),\n",
       " ('Port of Immingham', 'Port of Haifa'),\n",
       " ('Port of New York', 'Mina Salman'),\n",
       " ('Port of New York', 'Port of Haifa'),\n",
       " ('Port of Los Angeles', 'Mina Salman'),\n",
       " ('Port of Los Angeles', 'Port of Haifa'),\n",
       " ('Port of Saigon', 'Mina Salman'),\n",
       " ('Port of Saigon', 'Port of Haifa')]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "routes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Decision Variables\n",
    "X = LpVariable.dicts(\"ShipmentAmount\",(supply_points, demand_points),0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Buenos Aires': {'Mina Salman': ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa},\n",
       " 'Port of Antwerp': {'Mina Salman': ShipmentAmount_Port_of_Antwerp_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Antwerp_Port_of_Haifa},\n",
       " 'Port of Santos': {'Mina Salman': ShipmentAmount_Port_of_Santos_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Santos_Port_of_Haifa},\n",
       " 'Port of Montreal': {'Mina Salman': ShipmentAmount_Port_of_Montreal_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Montreal_Port_of_Haifa},\n",
       " 'Port of Vancouver': {'Mina Salman': ShipmentAmount_Port_of_Vancouver_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Vancouver_Port_of_Haifa},\n",
       " 'Port of Shanghai': {'Mina Salman': ShipmentAmount_Port_of_Shanghai_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Shanghai_Port_of_Haifa},\n",
       " 'Buenaventura': {'Mina Salman': ShipmentAmount_Buenaventura_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Buenaventura_Port_of_Haifa},\n",
       " 'Port of Alexandria': {'Mina Salman': ShipmentAmount_Port_of_Alexandria_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Alexandria_Port_of_Haifa},\n",
       " 'Port of Marseille': {'Mina Salman': ShipmentAmount_Port_of_Marseille_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Marseille_Port_of_Haifa},\n",
       " 'Port of Hamburg_Germany': {'Mina Salman': ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa},\n",
       " 'Port of Jawaharlal Nehru': {'Mina Salman': ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa},\n",
       " 'Port of Gioia Tauro': {'Mina Salman': ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa},\n",
       " 'Port of Nagoya': {'Mina Salman': ShipmentAmount_Port_of_Nagoya_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Nagoya_Port_of_Haifa},\n",
       " 'Port of Busan': {'Mina Salman': ShipmentAmount_Port_of_Busan_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Busan_Port_of_Haifa},\n",
       " 'Port of Shuwaikh': {'Mina Salman': ShipmentAmount_Port_of_Shuwaikh_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa},\n",
       " 'Penang Port': {'Mina Salman': ShipmentAmount_Penang_Port_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Penang_Port_Port_of_Haifa},\n",
       " 'Port of Manzanillo': {'Mina Salman': ShipmentAmount_Port_of_Manzanillo_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa},\n",
       " 'Port of Rotterdam': {'Mina Salman': ShipmentAmount_Port_of_Rotterdam_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa},\n",
       " 'Port of Lagos': {'Mina Salman': ShipmentAmount_Port_of_Lagos_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Lagos_Port_of_Haifa},\n",
       " 'Port of Salalah': {'Mina Salman': ShipmentAmount_Port_of_Salalah_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Salalah_Port_of_Haifa},\n",
       " 'Port of Gdansk': {'Mina Salman': ShipmentAmount_Port_of_Gdansk_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Gdansk_Port_of_Haifa},\n",
       " 'Port of Doha': {'Mina Salman': ShipmentAmount_Port_of_Doha_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Doha_Port_of_Haifa},\n",
       " 'Port of King Abdul Aziz': {'Mina Salman': ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa},\n",
       " 'Port of Jeddah': {'Mina Salman': ShipmentAmount_Port_of_Jeddah_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Jeddah_Port_of_Haifa},\n",
       " 'Port of Singapore': {'Mina Salman': ShipmentAmount_Port_of_Singapore_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Singapore_Port_of_Haifa},\n",
       " 'Port of Durban': {'Mina Salman': ShipmentAmount_Port_of_Durban_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Durban_Port_of_Haifa},\n",
       " 'Port of Algeciras': {'Mina Salman': ShipmentAmount_Port_of_Algeciras_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Algeciras_Port_of_Haifa},\n",
       " 'Port of Bangkok': {'Mina Salman': ShipmentAmount_Port_of_Bangkok_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Bangkok_Port_of_Haifa},\n",
       " 'Port of Jebel Ali': {'Mina Salman': ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa},\n",
       " 'Port of Immingham': {'Mina Salman': ShipmentAmount_Port_of_Immingham_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Immingham_Port_of_Haifa},\n",
       " 'Port of New York': {'Mina Salman': ShipmentAmount_Port_of_New_York_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_New_York_Port_of_Haifa},\n",
       " 'Port of Los Angeles': {'Mina Salman': ShipmentAmount_Port_of_Los_Angeles_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa},\n",
       " 'Port of Saigon': {'Mina Salman': ShipmentAmount_Port_of_Saigon_Mina_Salman,\n",
       "  'Port of Haifa': ShipmentAmount_Port_of_Saigon_Port_of_Haifa}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Objective Function\n",
    "prob += sum(X[i][j]*distance[i][j] for (i,j) in routes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "11561*ShipmentAmount_Buenaventura_Mina_Salman + 8173*ShipmentAmount_Buenaventura_Port_of_Haifa + 3856*ShipmentAmount_Penang_Port_Mina_Salman + 5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3650*ShipmentAmount_Port_of_Alexandria_Mina_Salman + 370*ShipmentAmount_Port_of_Alexandria_Port_of_Haifa + 5631*ShipmentAmount_Port_of_Algeciras_Mina_Salman + 2242*ShipmentAmount_Port_of_Algeciras_Port_of_Haifa + 7193*ShipmentAmount_Port_of_Antwerp_Mina_Salman + 3804*ShipmentAmount_Port_of_Antwerp_Port_of_Haifa + 5102*ShipmentAmount_Port_of_Bangkok_Mina_Salman + 6556*ShipmentAmount_Port_of_Bangkok_Port_of_Haifa + 9420*ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman + 8747*ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa + 7398*ShipmentAmount_Port_of_Busan_Mina_Salman + 8852*ShipmentAmount_Port_of_Busan_Port_of_Haifa + 140*ShipmentAmount_Port_of_Doha_Mina_Salman + 3553*ShipmentAmount_Port_of_Doha_Port_of_Haifa + 4824*ShipmentAmount_Port_of_Durban_Mina_Salman + 5318*ShipmentAmount_Port_of_Durban_Port_of_Haifa + 8277*ShipmentAmount_Port_of_Gdansk_Mina_Salman + 4889*ShipmentAmount_Port_of_Gdansk_Port_of_Haifa + 4620*ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman + 1230*ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa + 7561*ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman + 4173*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa + 7334*ShipmentAmount_Port_of_Immingham_Mina_Salman + 3944*ShipmentAmount_Port_of_Immingham_Port_of_Haifa + 1589*ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman + 3510*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa + 327*ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman + 3366*ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa + 2626*ShipmentAmount_Port_of_Jeddah_Mina_Salman + 995*ShipmentAmount_Port_of_Jeddah_Port_of_Haifa + 108*ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman + 3674*ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa + 8570*ShipmentAmount_Port_of_Lagos_Mina_Salman + 5662*ShipmentAmount_Port_of_Lagos_Port_of_Haifa + 14552*ShipmentAmount_Port_of_Los_Angeles_Mina_Salman + 11048*ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa + 13061*ShipmentAmount_Port_of_Manzanillo_Mina_Salman + 9673*ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa + 5332*ShipmentAmount_Port_of_Marseille_Mina_Salman + 1946*ShipmentAmount_Port_of_Marseille_Port_of_Haifa + 9594*ShipmentAmount_Port_of_Montreal_Mina_Salman + 6336*ShipmentAmount_Port_of_Montreal_Port_of_Haifa + 7759*ShipmentAmount_Port_of_Nagoya_Mina_Salman + 9214*ShipmentAmount_Port_of_Nagoya_Port_of_Haifa + 9168*ShipmentAmount_Port_of_New_York_Mina_Salman + 5756*ShipmentAmount_Port_of_New_York_Port_of_Haifa + 7284*ShipmentAmount_Port_of_Rotterdam_Mina_Salman + 3894*ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa + 4964*ShipmentAmount_Port_of_Saigon_Mina_Salman + 6418*ShipmentAmount_Port_of_Saigon_Port_of_Haifa + 1253*ShipmentAmount_Port_of_Salalah_Mina_Salman + 2367*ShipmentAmount_Port_of_Salalah_Port_of_Haifa + 9662*ShipmentAmount_Port_of_Santos_Mina_Salman + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 6882*ShipmentAmount_Port_of_Shanghai_Mina_Salman + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 310*ShipmentAmount_Port_of_Shuwaikh_Mina_Salman + 3847*ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa + 4226*ShipmentAmount_Port_of_Singapore_Mina_Salman + 5680*ShipmentAmount_Port_of_Singapore_Port_of_Haifa + 15871*ShipmentAmount_Port_of_Vancouver_Mina_Salman + 12461*ShipmentAmount_Port_of_Vancouver_Port_of_Haifa + 0\n",
       "VARIABLES\n",
       "ShipmentAmount_Buenaventura_Mina_Salman Continuous\n",
       "ShipmentAmount_Buenaventura_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Mina_Salman Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Alexandria_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Alexandria_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Algeciras_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Algeciras_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Antwerp_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Antwerp_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Busan_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Doha_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Doha_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Durban_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Durban_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Gdansk_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Gdansk_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jeddah_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jeddah_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_New_York_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Rotterdam_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Salalah_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Salalah_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shuwaikh_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Singapore_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Singapore_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Haifa Continuous"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "11561*ShipmentAmount_Buenaventura_Mina_Salman + 8173*ShipmentAmount_Buenaventura_Port_of_Haifa + 3856*ShipmentAmount_Penang_Port_Mina_Salman + 5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3650*ShipmentAmount_Port_of_Alexandria_Mina_Salman + 370*ShipmentAmount_Port_of_Alexandria_Port_of_Haifa + 5631*ShipmentAmount_Port_of_Algeciras_Mina_Salman + 2242*ShipmentAmount_Port_of_Algeciras_Port_of_Haifa + 7193*ShipmentAmount_Port_of_Antwerp_Mina_Salman + 3804*ShipmentAmount_Port_of_Antwerp_Port_of_Haifa + 5102*ShipmentAmount_Port_of_Bangkok_Mina_Salman + 6556*ShipmentAmount_Port_of_Bangkok_Port_of_Haifa + 9420*ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman + 8747*ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa + 7398*ShipmentAmount_Port_of_Busan_Mina_Salman + 8852*ShipmentAmount_Port_of_Busan_Port_of_Haifa + 140*ShipmentAmount_Port_of_Doha_Mina_Salman + 3553*ShipmentAmount_Port_of_Doha_Port_of_Haifa + 4824*ShipmentAmount_Port_of_Durban_Mina_Salman + 5318*ShipmentAmount_Port_of_Durban_Port_of_Haifa + 8277*ShipmentAmount_Port_of_Gdansk_Mina_Salman + 4889*ShipmentAmount_Port_of_Gdansk_Port_of_Haifa + 4620*ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman + 1230*ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa + 7561*ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman + 4173*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa + 7334*ShipmentAmount_Port_of_Immingham_Mina_Salman + 3944*ShipmentAmount_Port_of_Immingham_Port_of_Haifa + 1589*ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman + 3510*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa + 327*ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman + 3366*ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa + 2626*ShipmentAmount_Port_of_Jeddah_Mina_Salman + 995*ShipmentAmount_Port_of_Jeddah_Port_of_Haifa + 108*ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman + 3674*ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa + 8570*ShipmentAmount_Port_of_Lagos_Mina_Salman + 5662*ShipmentAmount_Port_of_Lagos_Port_of_Haifa + 14552*ShipmentAmount_Port_of_Los_Angeles_Mina_Salman + 11048*ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa + 13061*ShipmentAmount_Port_of_Manzanillo_Mina_Salman + 9673*ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa + 5332*ShipmentAmount_Port_of_Marseille_Mina_Salman + 1946*ShipmentAmount_Port_of_Marseille_Port_of_Haifa + 9594*ShipmentAmount_Port_of_Montreal_Mina_Salman + 6336*ShipmentAmount_Port_of_Montreal_Port_of_Haifa + 7759*ShipmentAmount_Port_of_Nagoya_Mina_Salman + 9214*ShipmentAmount_Port_of_Nagoya_Port_of_Haifa + 9168*ShipmentAmount_Port_of_New_York_Mina_Salman + 5756*ShipmentAmount_Port_of_New_York_Port_of_Haifa + 7284*ShipmentAmount_Port_of_Rotterdam_Mina_Salman + 3894*ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa + 4964*ShipmentAmount_Port_of_Saigon_Mina_Salman + 6418*ShipmentAmount_Port_of_Saigon_Port_of_Haifa + 1253*ShipmentAmount_Port_of_Salalah_Mina_Salman + 2367*ShipmentAmount_Port_of_Salalah_Port_of_Haifa + 9662*ShipmentAmount_Port_of_Santos_Mina_Salman + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 6882*ShipmentAmount_Port_of_Shanghai_Mina_Salman + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 310*ShipmentAmount_Port_of_Shuwaikh_Mina_Salman + 3847*ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa + 4226*ShipmentAmount_Port_of_Singapore_Mina_Salman + 5680*ShipmentAmount_Port_of_Singapore_Port_of_Haifa + 15871*ShipmentAmount_Port_of_Vancouver_Mina_Salman + 12461*ShipmentAmount_Port_of_Vancouver_Port_of_Haifa + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Buenaventura_Mina_Salman\n",
       " + ShipmentAmount_Penang_Port_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Alexandria_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Algeciras_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Antwerp_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Bangkok_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Busan_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Doha_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Durban_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Gdansk_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Immingham_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jeddah_Mina_Salman\n",
       " + ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Lagos_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Manzanillo_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Marseille_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Montreal_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Nagoya_Mina_Salman\n",
       " + ShipmentAmount_Port_of_New_York_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Rotterdam_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Saigon_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Salalah_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Santos_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Shanghai_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Shuwaikh_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Singapore_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Vancouver_Mina_Salman >= 275042389.8\n",
       "\n",
       "_C2: ShipmentAmount_Buenaventura_Port_of_Haifa\n",
       " + ShipmentAmount_Penang_Port_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Alexandria_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Algeciras_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Antwerp_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Doha_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Durban_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Gdansk_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jeddah_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Salalah_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Singapore_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Haifa >= 239192472.7\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Buenaventura_Mina_Salman Continuous\n",
       "ShipmentAmount_Buenaventura_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Mina_Salman Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Alexandria_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Alexandria_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Algeciras_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Algeciras_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Antwerp_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Antwerp_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Busan_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Doha_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Doha_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Durban_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Durban_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Gdansk_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Gdansk_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jeddah_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jeddah_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_New_York_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Rotterdam_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Salalah_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Salalah_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shuwaikh_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Singapore_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Singapore_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Haifa Continuous"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for j in demand_points:\n",
    "    prob += sum(X[i][j] for i in supply_points) >= plastic_demand[j]\n",
    "    \n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "11561*ShipmentAmount_Buenaventura_Mina_Salman + 8173*ShipmentAmount_Buenaventura_Port_of_Haifa + 3856*ShipmentAmount_Penang_Port_Mina_Salman + 5310*ShipmentAmount_Penang_Port_Port_of_Haifa + 3650*ShipmentAmount_Port_of_Alexandria_Mina_Salman + 370*ShipmentAmount_Port_of_Alexandria_Port_of_Haifa + 5631*ShipmentAmount_Port_of_Algeciras_Mina_Salman + 2242*ShipmentAmount_Port_of_Algeciras_Port_of_Haifa + 7193*ShipmentAmount_Port_of_Antwerp_Mina_Salman + 3804*ShipmentAmount_Port_of_Antwerp_Port_of_Haifa + 5102*ShipmentAmount_Port_of_Bangkok_Mina_Salman + 6556*ShipmentAmount_Port_of_Bangkok_Port_of_Haifa + 9420*ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman + 8747*ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa + 7398*ShipmentAmount_Port_of_Busan_Mina_Salman + 8852*ShipmentAmount_Port_of_Busan_Port_of_Haifa + 140*ShipmentAmount_Port_of_Doha_Mina_Salman + 3553*ShipmentAmount_Port_of_Doha_Port_of_Haifa + 4824*ShipmentAmount_Port_of_Durban_Mina_Salman + 5318*ShipmentAmount_Port_of_Durban_Port_of_Haifa + 8277*ShipmentAmount_Port_of_Gdansk_Mina_Salman + 4889*ShipmentAmount_Port_of_Gdansk_Port_of_Haifa + 4620*ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman + 1230*ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa + 7561*ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman + 4173*ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa + 7334*ShipmentAmount_Port_of_Immingham_Mina_Salman + 3944*ShipmentAmount_Port_of_Immingham_Port_of_Haifa + 1589*ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman + 3510*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa + 327*ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman + 3366*ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa + 2626*ShipmentAmount_Port_of_Jeddah_Mina_Salman + 995*ShipmentAmount_Port_of_Jeddah_Port_of_Haifa + 108*ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman + 3674*ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa + 8570*ShipmentAmount_Port_of_Lagos_Mina_Salman + 5662*ShipmentAmount_Port_of_Lagos_Port_of_Haifa + 14552*ShipmentAmount_Port_of_Los_Angeles_Mina_Salman + 11048*ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa + 13061*ShipmentAmount_Port_of_Manzanillo_Mina_Salman + 9673*ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa + 5332*ShipmentAmount_Port_of_Marseille_Mina_Salman + 1946*ShipmentAmount_Port_of_Marseille_Port_of_Haifa + 9594*ShipmentAmount_Port_of_Montreal_Mina_Salman + 6336*ShipmentAmount_Port_of_Montreal_Port_of_Haifa + 7759*ShipmentAmount_Port_of_Nagoya_Mina_Salman + 9214*ShipmentAmount_Port_of_Nagoya_Port_of_Haifa + 9168*ShipmentAmount_Port_of_New_York_Mina_Salman + 5756*ShipmentAmount_Port_of_New_York_Port_of_Haifa + 7284*ShipmentAmount_Port_of_Rotterdam_Mina_Salman + 3894*ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa + 4964*ShipmentAmount_Port_of_Saigon_Mina_Salman + 6418*ShipmentAmount_Port_of_Saigon_Port_of_Haifa + 1253*ShipmentAmount_Port_of_Salalah_Mina_Salman + 2367*ShipmentAmount_Port_of_Salalah_Port_of_Haifa + 9662*ShipmentAmount_Port_of_Santos_Mina_Salman + 7667*ShipmentAmount_Port_of_Santos_Port_of_Haifa + 6882*ShipmentAmount_Port_of_Shanghai_Mina_Salman + 8336*ShipmentAmount_Port_of_Shanghai_Port_of_Haifa + 310*ShipmentAmount_Port_of_Shuwaikh_Mina_Salman + 3847*ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa + 4226*ShipmentAmount_Port_of_Singapore_Mina_Salman + 5680*ShipmentAmount_Port_of_Singapore_Port_of_Haifa + 15871*ShipmentAmount_Port_of_Vancouver_Mina_Salman + 12461*ShipmentAmount_Port_of_Vancouver_Port_of_Haifa + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Buenaventura_Mina_Salman\n",
       " + ShipmentAmount_Penang_Port_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Alexandria_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Algeciras_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Antwerp_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Bangkok_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Busan_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Doha_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Durban_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Gdansk_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Immingham_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jeddah_Mina_Salman\n",
       " + ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Lagos_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Manzanillo_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Marseille_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Montreal_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Nagoya_Mina_Salman\n",
       " + ShipmentAmount_Port_of_New_York_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Rotterdam_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Saigon_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Salalah_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Santos_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Shanghai_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Shuwaikh_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Singapore_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Vancouver_Mina_Salman >= 275042389.8\n",
       "\n",
       "_C2: ShipmentAmount_Buenaventura_Port_of_Haifa\n",
       " + ShipmentAmount_Penang_Port_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Alexandria_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Algeciras_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Antwerp_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Doha_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Durban_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Gdansk_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Jeddah_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Salalah_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Singapore_Port_of_Haifa\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Haifa >= 239192472.7\n",
       "\n",
       "_C3: ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa = 3484953.6435\n",
       "\n",
       "_C4: ShipmentAmount_Port_of_Antwerp_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Antwerp_Port_of_Haifa = 3021067.502\n",
       "\n",
       "_C5: ShipmentAmount_Port_of_Santos_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Haifa = 7945692.0017\n",
       "\n",
       "_C6: ShipmentAmount_Port_of_Montreal_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Montreal_Port_of_Haifa = 1637839.3004\n",
       "\n",
       "_C7: ShipmentAmount_Port_of_Vancouver_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Vancouver_Port_of_Haifa = 7771532.4984\n",
       "\n",
       "_C8: ShipmentAmount_Port_of_Shanghai_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Haifa = 234997919.661\n",
       "\n",
       "_C9: ShipmentAmount_Buenaventura_Mina_Salman\n",
       " + ShipmentAmount_Buenaventura_Port_of_Haifa = 2509165.8953\n",
       "\n",
       "_C10: ShipmentAmount_Port_of_Alexandria_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Alexandria_Port_of_Haifa = 731840.0219\n",
       "\n",
       "_C11: ShipmentAmount_Port_of_Marseille_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Marseille_Port_of_Haifa = 6474235.9733\n",
       "\n",
       "_C12: ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa = 16669297.2185\n",
       "\n",
       "_C13: ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa = 10078880.5696\n",
       "\n",
       "_C14: ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa = 9565903.5174\n",
       "\n",
       "_C15: ShipmentAmount_Port_of_Nagoya_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Nagoya_Port_of_Haifa = 13163659.9622\n",
       "\n",
       "_C16: ShipmentAmount_Port_of_Busan_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Busan_Port_of_Haifa = 44795024.7538\n",
       "\n",
       "_C17: ShipmentAmount_Port_of_Shuwaikh_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa = 887965.8933\n",
       "\n",
       "_C18: ShipmentAmount_Penang_Port_Mina_Salman\n",
       " + ShipmentAmount_Penang_Port_Port_of_Haifa = 12318631.8073\n",
       "\n",
       "_C19: ShipmentAmount_Port_of_Manzanillo_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa = 6272914.5326\n",
       "\n",
       "_C20: ShipmentAmount_Port_of_Rotterdam_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa = 2745849.666\n",
       "\n",
       "_C21: ShipmentAmount_Port_of_Lagos_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Haifa = 243946.674\n",
       "\n",
       "_C22: ShipmentAmount_Port_of_Salalah_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Salalah_Port_of_Haifa = 665974.42\n",
       "\n",
       "_C23: ShipmentAmount_Port_of_Gdansk_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Gdansk_Port_of_Haifa = 4350000.5481\n",
       "\n",
       "_C24: ShipmentAmount_Port_of_Doha_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Doha_Port_of_Haifa = 1775931.7866\n",
       "\n",
       "_C25: ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman\n",
       " + ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa = 9520988.2609\n",
       "\n",
       "_C26: ShipmentAmount_Port_of_Jeddah_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jeddah_Port_of_Haifa = 5352440.4517\n",
       "\n",
       "_C27: ShipmentAmount_Port_of_Singapore_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Singapore_Port_of_Haifa = 20157761.1392\n",
       "\n",
       "_C28: ShipmentAmount_Port_of_Durban_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Durban_Port_of_Haifa = 1219733.3699\n",
       "\n",
       "_C29: ShipmentAmount_Port_of_Algeciras_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Algeciras_Port_of_Haifa = 5144723.8347\n",
       "\n",
       "_C30: ShipmentAmount_Port_of_Bangkok_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Haifa = 19037885.5204\n",
       "\n",
       "_C31: ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa = 3995846.5198\n",
       "\n",
       "_C32: ShipmentAmount_Port_of_Immingham_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Immingham_Port_of_Haifa = 5051019.5284\n",
       "\n",
       "_C33: ShipmentAmount_Port_of_New_York_Mina_Salman\n",
       " + ShipmentAmount_Port_of_New_York_Port_of_Haifa = 27723150.5426\n",
       "\n",
       "_C34: ShipmentAmount_Port_of_Los_Angeles_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa = 19323708.4517\n",
       "\n",
       "_C35: ShipmentAmount_Port_of_Saigon_Mina_Salman\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Haifa = 5599378.0942\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Buenaventura_Mina_Salman Continuous\n",
       "ShipmentAmount_Buenaventura_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Penang_Port_Mina_Salman Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Alexandria_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Alexandria_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Algeciras_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Algeciras_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Antwerp_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Antwerp_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Buenos_Aires_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Busan_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Busan_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Doha_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Doha_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Durban_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Durban_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Gdansk_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Gdansk_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Gioia_Tauro_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Immingham_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jebel_Ali_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Jeddah_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Jeddah_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_King_Abdul_Aziz_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Marseille_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Montreal_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Nagoya_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_New_York_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_New_York_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Rotterdam_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Salalah_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Salalah_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Santos_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Shuwaikh_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Shuwaikh_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Singapore_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Singapore_Port_of_Haifa Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Mina_Salman Continuous\n",
       "ShipmentAmount_Port_of_Vancouver_Port_of_Haifa Continuous"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for i in supply_points:\n",
    "    prob += sum(X[i][j] for j in demand_points) == plastic_supply[i]\n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Status: Optimal\n",
      "ShipmentAmount_Buenaventura_Port_of_Haifa = 2509165.9\n",
      "ShipmentAmount_Penang_Port_Port_of_Haifa = 12318632.0\n",
      "ShipmentAmount_Port_of_Alexandria_Port_of_Haifa = 731840.02\n",
      "ShipmentAmount_Port_of_Algeciras_Port_of_Haifa = 5144723.8\n",
      "ShipmentAmount_Port_of_Antwerp_Port_of_Haifa = 3021067.5\n",
      "ShipmentAmount_Port_of_Bangkok_Port_of_Haifa = 19037886.0\n",
      "ShipmentAmount_Port_of_Buenos_Aires_Port_of_Haifa = 3484953.6\n",
      "ShipmentAmount_Port_of_Busan_Port_of_Haifa = 44795025.0\n",
      "ShipmentAmount_Port_of_Doha_Mina_Salman = 1775931.8\n",
      "ShipmentAmount_Port_of_Durban_Port_of_Haifa = 1219733.4\n",
      "ShipmentAmount_Port_of_Gdansk_Port_of_Haifa = 4350000.5\n",
      "ShipmentAmount_Port_of_Gioia_Tauro_Port_of_Haifa = 9565903.5\n",
      "ShipmentAmount_Port_of_Hamburg_Germany_Port_of_Haifa = 16669297.0\n",
      "ShipmentAmount_Port_of_Immingham_Port_of_Haifa = 5051019.5\n",
      "ShipmentAmount_Port_of_Jawaharlal_Nehru_Mina_Salman = 10078881.0\n",
      "ShipmentAmount_Port_of_Jebel_Ali_Mina_Salman = 3995846.5\n",
      "ShipmentAmount_Port_of_Jeddah_Port_of_Haifa = 5352440.5\n",
      "ShipmentAmount_Port_of_King_Abdul_Aziz_Mina_Salman = 9520988.3\n",
      "ShipmentAmount_Port_of_Lagos_Port_of_Haifa = 243946.67\n",
      "ShipmentAmount_Port_of_Los_Angeles_Port_of_Haifa = 19323708.0\n",
      "ShipmentAmount_Port_of_Manzanillo_Port_of_Haifa = 6272914.5\n",
      "ShipmentAmount_Port_of_Marseille_Port_of_Haifa = 6474236.0\n",
      "ShipmentAmount_Port_of_Montreal_Port_of_Haifa = 1637839.3\n",
      "ShipmentAmount_Port_of_Nagoya_Mina_Salman = 13163660.0\n",
      "ShipmentAmount_Port_of_New_York_Port_of_Haifa = 27723151.0\n",
      "ShipmentAmount_Port_of_Rotterdam_Port_of_Haifa = 2745849.7\n",
      "ShipmentAmount_Port_of_Saigon_Port_of_Haifa = 5599378.1\n",
      "ShipmentAmount_Port_of_Salalah_Port_of_Haifa = 665974.42\n",
      "ShipmentAmount_Port_of_Santos_Port_of_Haifa = 7945692.0\n",
      "ShipmentAmount_Port_of_Shanghai_Mina_Salman = 215461360.0\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Haifa = 19536563.0\n",
      "ShipmentAmount_Port_of_Shuwaikh_Mina_Salman = 887965.89\n",
      "ShipmentAmount_Port_of_Singapore_Mina_Salman = 20157761.0\n",
      "ShipmentAmount_Port_of_Vancouver_Port_of_Haifa = 7771532.5\n",
      "Total kilogram_miles = 3311289078793.9795\n"
     ]
    }
   ],
   "source": [
    "prob.solve()\n",
    "\n",
    "print(\"Status:\", LpStatus[prob.status])\n",
    "\n",
    "for v in prob.variables():\n",
    "    if v.varValue > 0:\n",
    "        print(v.name, \"=\", v.varValue)\n",
    "\n",
    "print(\"Total kilogram_miles =\", value(prob.objective))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
